-
Notifications
You must be signed in to change notification settings - Fork 467
Add mistral-common library #1641
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Hi @juliendenize , thanks for the PR. In the ecosystem we consider vLLM as a Local App rather than a library. If you go on https://huggingface.co/mistralai/Mistral-Small-24B-Base-2501?local-app=vllm for instance, you'll see how to serve the model using vLLM. If you are interested in counting the downloads of model repos based on # (to add in alphabetical order)
"mistral-common": {
prettyLabel: "mistral-common",
repoName: "mistral-common",
repoUrl: "https://github.com/mistralai/mistral-common",
docsUrl: "https://mistralai.github.io/mistral-common/",
countDownloads: `path:"config.json" OR path:"params.json"`,
}, (I haven't added a code snippet as I'm unsure how to use mistral common) You'll also have to add |
Regarding the PR itself, we won't merge it in its current form. vLLM is a widely used app that is not specific to mistral-common (see https://huggingface.co/models?other=vllm) so we don't want the snippet to include mistral-specific instructions for all of them. |
Btw, vllm snippets are defined here. It is possible to update the install command to include |
Hi @Wauplin thanks a lot for your detailed feedback and given me the context and the pointers ! much appreciated.
This was indeed also a concern for me when I pushed the original PR, and also why I put Mistral related instruction in comments. So, very cool that your proposed solution avoids that. I updated the PR accordingly. I just have a question regarding how tags works, is the library_name considered as a tag ? meaning would that be True: model.tags.includes("mistral-common") // = True ? Or should I update the PR to check the library_name ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @juliendenize , model.tags.includes("mistral-common")
is the correct way!
"# Make sure you have the latest version of mistral-common installed:", | ||
"pip install --upgrade mistral-common" | ||
].join(""); | ||
dockerCommand = `# Load and run the model:\ndocker exec -it my_vllm_container bash -c "vllm serve ${model.id} --tokenizer_mode mistral --config_format mistral --load_format mistral --tool-call-parser mistral --enable-auto-tool-choice"`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
out of curiosity, what happens if one runs docker exec -it my_vllm_container bash -c "vllm serve ${model.id}"
instead of having all the mistral arguments? In general we avoid putting too many options in the snippets like this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It wouldn't know how to load the model correctly so failing :/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wouldn't this be something to fix on vllm side directly? feels weird if all vllm-compatible models can be correctly served with vllm server <model id>
except the mistral-common ones that requires a very specific command
(not against adding it, just wondering why it's not a default)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry my previous info was not complete, here is the behavior:
- if transformers weights exist, it will load the model with transformers format => not our official way
- if not, it will fail
So vLLM cannot know how to load the models without specifying the args.
And we can't only look if mistral-common is installed as it's a hard dependency of vLLM.
|
||
export const mistral_common = (model: ModelData): string[] => [ | ||
`# We recommend to use vLLM to serve Mistral AI models. | ||
pip install vllm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is mistral-common
usable "as-is" or only under vLLM ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mistral-common
is a processing library and we always advise people to use vllm to serve our models (except for GGUFs). vLLM
internally integrates mistral-common and use it when we correctly configure the serving.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks for the indications. Before merging, can you make sure some models are listed under https://huggingface.co/models?other=mistral-common ? To do that you need to tag them as such in the model cards (library_name: mistral-common
) . You can set tags: - vllm
separately if you'd like but it shouldn't be as library_name
otherwise the download count rule introduced in this PR will be ignored (since we only take the rule from the "main" library)
Co-authored-by: Lucain <lucainp@gmail.com>
Co-authored-by: Lucain <lucainp@gmail.com>
@Wauplin Should be good ! thanks for approving and suggestions |
Hey @juliendenize thanks for the iterations. Last thing, can you run the linter to fix https://github.com/huggingface/huggingface.js/actions/runs/16469991767/job/46561455759?pr=1641 please ? |
Yeah sorry about that @Wauplin just ran |
Merged! Expect a few days before getting it live on the Hub :) |
Hi !
We'd like to add vLLM as a library and track the downloads via two possible formats:
config.json
params.json
The code snippet suggested is through serving.
Edit:
Based on @Wauplin comment we changed the integration to instead add the
mistral-common
library